package com.msstudio.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

public class CommonUtil {
	private static final Logger logger = Logger.getLogger(
			CommonUtil.class.getName());

	public static Properties readHostsConf(String fileName) {
		FileInputStream in = null;
		Properties properties = new Properties();
		try {
			in = new FileInputStream(fileName);
			properties.load(in);			
		} catch (Exception e) {
			logger.log(Level.SEVERE, e.getMessage());
			return null;
		} finally {
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		return properties;
	}

}
